package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.SalePointsMapper;
import com.dongdongshop.pojo.salePoints.SalePoints;
import com.dongdongshop.pojo.salePoints.SalePointsExample;
import com.dongdongshop.service.SalePointServiceI;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Service
public class SalePointServiceImpl implements SalePointServiceI {

    @Resource
    private SalePointsMapper salePointsMapper;

    @Override
    public void insertSalePoints(SalePoints salePoints1) {
        salePointsMapper.insertSelective(salePoints1);
    }

    @Override
    public void updatePoints(SalePoints salePoints) {
        salePointsMapper.updateByPrimaryKeySelective(salePoints);
    }

    @Override
    public SalePoints selectByUserId(String userId) {
        return salePointsMapper.selectByUserId(userId);
        /*SalePointsExample example=new SalePointsExample();
        SalePointsExample.Criteria criteria = example.createCriteria();
        criteria.andUserIdEqualTo(userId);
        return (SalePoints) salePointsMapper.selectByExample(example);*/
    }
}
